<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/products.js"></script> 
<link href="./styles/general.css" rel="stylesheet" type="text/css" />
<link href="./styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../images/jquery.js"></script>
<style>
	table tr td{ text-align:center;}
</style>
<title></title>
<script type="text/javascript">
$(function(){
	if(<{$productIDlist}>)
	{
		<{foreach from=$productIDlist key=myID item=id}>
			$("#product_<{$id.store_product_id}>").attr("checked",true); 
			$("#product_sort_<{$id.store_product_id}>").html("<{$id.store_product_sort}>");
		<{/foreach}>
	}
});
function change_image(product_id,store_id,product_name)
{

		if($('#product_'+product_id).attr("checked"))
		{
		
				$('#product_'+product_id).attr("checked",true); 
				$.post("./store.php?action=AddLinkProduct",{product_id:product_id,store_id:store_id},function(data){});
				$("#product_sort_"+product_id).html("0");
				$("#product_sort_"+product_id).click(); 
				$("#input_product_sort_"+product_id).focus();
			
		}
		else
		{

				$('#product_'+product_id).attr("checked",false); 
				$.post("./store.php?action=DelLinkProduct",{product_id:product_id,store_id:store_id},function(data){
				   $("#product_sort_"+product_id).html("");
				   
				});
	
				
		
		}
}
</script>
</head>
<body style="width:710px;">
<form method="POST" action="./store.php?action=SearchProductList&search_type=1">

    <img height="22" border="0" width="26" alt="SEARCH" src="../images/icon_search.gif">
    <!-- 推荐 -->
    <select name="product_is_link"><option value="0">全部</option><option value="1">已关联</option><option value="2"> 未关联</option></select>
        <!-- 关键字 -->
    关键字 <input type="text" size="25" name="search_key"><input type="submit" class="button"  name="search" value=" 搜索 ">
    <input type="hidden" name="store_id" value="<{$store_id}>">

</form>
<form>
 <{if count($productlist)<=0}>
  <h2 style="text-align:center;">没有数据</h2>
  <{else}>
  <table width="100%" cellspacing="1" cellpadding="2" id="list-table" class="list-div">
    <tr>
      <th width="10%">是否关联</th>
	  <th width="10%">产品排序</th>
      <th width="10%">产品编号</th>
      <th width="40%">产品名称</th>
      <th width="10%">版本号</th>
      <th width="10%">产品价格</th>
      <th width="10%">发布状态</th>
    </tr>
    <{foreach from=$productlist key=myID item=product}>
    <tr id="tr_<{$product.product_id}>">
      <td width="10%"><input type="checkbox" id="product_<{$product.product_id}>" onclick="change_image(<{$product.product_id}>,<{$store_id}>,'<{$product.product_name}>')" ></td>
      <td width="10%" id="td_product_sort_<{$product.product_id}>"><span   onmouseout="check_css('product_sort_<{$attributes.id}>',0);" onmouseover="check_css('product_sort_<{$attributes.id}>',1);" onclick="check_info('<{$product.product_id}>','product_sort_<{$product.product_id}>','td_product_sort_<{$product.product_id}>','30','product_sort');"  id="product_sort_<{$product.product_id}>" ></span></td>
	  <td width="10%"><{$product.product_sn}></td>
      <td width="40%"><{$product.product_name}></td>
      <td width="10%"><{$product.product_version}></td>
      <td width="10%"><{$product.product_price}></td>
      <td width="10%"><{$product.product_state}></td>
    </tr>
    <{/foreach}>
    <tr>
    <td colspan="10"><{$page_url}> &nbsp;&nbsp;&nbsp; 共有 <span id="total"><{$total}> </span>条记录</td>
    </tr>
  </table>
  <input type="hidden" name="store_id" id="store_id" value="<{$store_id}>" />
<{/if}>
</form>
</body>
</html>
